package cn.buk.jedis;

/**
 * Created by yfdai on 15/5/18.
 */
public class Redis {

    /**
     * 酒店信息失效时长（单位：秒）.
     * 0: 不失效
     */
    public static final int EXPIRED_TIME_FOR_HOTEL_INFO = 0;
    /**
     * 酒店所有价格计划失效时长
     */
    public static final int EXPIRED_TIME_FOR_HOTEL_ALL_RATE_PLAN = 0;

    /**
     * 指定入住日期可以使用的的限制显示数量的酒店价格计划的有效时长（单位：s)
     */
    public static final int EXPIRED_TIME_FOR_HOTEL_RATE_PLAN_ON_PERIOD_WITH_LIMIT = 8 * 60 * 60;


    /**
     * redis key: 保存酒店所有rateplan数据的key
     */
    public static final String KEY_HOTEL_RATE_PLAN_ALL = "hotel:%s:rateplan:all";
    public static final String KEY_HOTEL_DETAIL = "hotel:%s";

    public static final String KEY_HOTEL_CODE_ALL = "hotel:hotelCode:all";
    public static final String KEY_HOTEL_CODE_BY_CITY = "hotel:hotelCode:cityId:%d";
    public static final String KEY_HOTEL_CODE_ALL_FROM_CACHE_DETAIL = "hotel:hotelCode:all:detail";
    public static final String KEY_HOTEL_CODE_FROM_CACHE_DETAIL_BY_CITY = "hotel:hotelCode:cityId:%d:detail";

    public static final String KEY_HOTEL_RATE_PLAN_IN_PERIOD_LIMIT = "hotel:%s:rateplan:date:%tyyyyMMdd:%tyyyyMMdd:%d";

    /**
     * 航班查询KEY
     */
    public static final String KEY_FLIGHT_SEARCH_RESULT = "flight:search:%s-%s-%s";
    public static final String KEY_FLIGHT_POLICY_RESULT = "flight:policy:%s-%s-%s";

    /**
     * 航班查询结果的保留时间
     */
    public static final int EXPIRED_TIME_FROM_FLIGHT_SEARCH = 10 * 60;

    public static final String CTRIP_KEY_FLIGHT_SEARCH_RESULT = "ctrip:flight:search:%s-%s-%s";
    public static final String QUNAR_KEY_FLIGHT_POLICY_RESULT = "qunar:flight:policy:%s-%s-%s";
}
